// Copyright (C) 2022-2022 wuchengwen. All Rights Reserved.
// Description:
// Author : wuchengwen <wuchw@foxmail.com>
// Date :2022-08-28

#include <iostream>
#include <string>

using namespace std;
// https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers
int main()
{
    struct A {
        int x;
        char y;
        string z;
    } a = {.z = "123"}; // 可以按照结构体成员名称，进行赋值

    A a1 {1, 'c'}; // 可以按照结构体成员顺序进行赋值

    // A a2{.z = "123", .y = 'c'}; // 初始化的成员的先后顺序不能乱
    return 0;
}